package com.springcloud.configclient.consumer.controller;

import com.springcloud.configclient.consumer.remote.HelloRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName HelloController
 * @Description
 * @Author xuan
 * @Date 2020/12/3 11:13
 * @Version 1.0
 */
@RestController
public class HelloController {
    @Autowired
    HelloRemote helloRemote;

    @RequestMapping("/hello/{name}")
    public String index(@PathVariable("name") String name) {
        return helloRemote.hello(name);
    }



    @RequestMapping("/happy/{msg}")
    public String happy(@PathVariable("msg") String msg) {
        return helloRemote.test(msg);
    }
}